package edu.szu.huhanpeng.doodlingFight.controller.mainHandler 
{
	import com.bit101.components.Panel;
	import edu.szu.huhanpeng.doodlingFight.view.MsgDlgBoxMed;
	import edu.szu.huhanpeng.doodlingFight.view.StageMed;
	import edu.szu.huhanpeng.doodlingFight.view.StagePanelMed;
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class HrShowMsgDlg extends SimpleCommand implements ICommand, INotifier 
	{
		
		override public function execute(note:INotification):void 
		{
			var body:Array = note.getBody() as Array;
			
			var stagePanelMed:StagePanelMed = facade.retrieveMediator( StagePanelMed.NAME ) as StagePanelMed;
			var msgDlgMed:MsgDlgBoxMed = facade.retrieveMediator( MsgDlgBoxMed.NAME ) as MsgDlgBoxMed;
			msgDlgMed.setMsg( body[0] as String )
			msgDlgMed.setCallBack( body[1] as Function );
			msgDlgMed.setFuncArgs( body[2] as Array );
			
			stagePanelMed.addChild( msgDlgMed.getViewComponent() as DisplayObject );
			
			//居中
			var stagePanel:Panel = stagePanelMed.getViewComponent() as Panel;
			msgDlgMed.moveToCenter(stagePanel.width, stagePanel.height);
		}
		
	}

}